package com.wd.elec.service.impl;

import java.util.List;
import com.wd.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.wd.elec.mapper.AttendHolidayMapper;
import com.wd.elec.domain.AttendHoliday;
import com.wd.elec.service.IAttendHolidayService;

/**
 * 假期配置Service业务层处理
 * 
 * @author liumingkun
 * @date 2023-11-08
 */
@Service
public class AttendHolidayService implements IAttendHolidayService
{
    @Resource
    private AttendHolidayMapper attendHolidayMapper;

    /**
     * 查询假期配置
     * 
     * @param holidayId 假期配置主键
     * @return 假期配置
     */
    @Override
    public AttendHoliday selectAttendHolidayByHolidayId(Long holidayId)
    {
        return attendHolidayMapper.selectAttendHolidayByHolidayId(holidayId);
    }

    /**
     * 查询假期配置列表
     * 
     * @param attendHoliday 假期配置
     * @return 假期配置
     */
    @Override
    public List<AttendHoliday> selectAttendHolidayList(AttendHoliday attendHoliday)
    {
        return attendHolidayMapper.selectAttendHolidayList(attendHoliday);
    }

    /**
     * 新增假期配置
     * 
     * @param attendHoliday 假期配置
     * @return 结果
     */
    @Override
    public int insertAttendHoliday(AttendHoliday attendHoliday)
    {
        attendHoliday.setCreateTime(DateUtils.getNowDate());
        return attendHolidayMapper.insertAttendHoliday(attendHoliday);
    }

    /**
     * 修改假期配置
     * 
     * @param attendHoliday 假期配置
     * @return 结果
     */
    @Override
    public int updateAttendHoliday(AttendHoliday attendHoliday)
    {
        attendHoliday.setUpdateTime(DateUtils.getNowDate());
        return attendHolidayMapper.updateAttendHoliday(attendHoliday);
    }

    /**
     * 批量删除假期配置
     * 
     * @param holidayIds 需要删除的假期配置主键
     * @return 结果
     */
    @Override
    public int deleteAttendHolidayByHolidayIds(Long[] holidayIds)
    {
        return attendHolidayMapper.deleteAttendHolidayByHolidayIds(holidayIds);
    }

    /**
     * 删除假期配置信息
     * 
     * @param holidayId 假期配置主键
     * @return 结果
     */
    @Override
    public int deleteAttendHolidayByHolidayId(Long holidayId)
    {
        return attendHolidayMapper.deleteAttendHolidayByHolidayId(holidayId);
    }
}
